﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TERP.Utils;
using TERP.WaterClient.Entities.Auth;

namespace TERP.WaterClient.Common
{
    class SystemGlobal
    {
        public static string strDealerCode = CommonUtils.Registry.GetKey("HKEY_CURRENT_USER\\Software\\ITS\\ERP.ServiceMng", "DealerCode", "VNN").ToString();

		public static double strPriceBinh = 0;
		public static double strPriceCuocVo = 0;
		public static double strPriceThung = 0;

		public static string strUnitCodePriceBinh = "BINH";
		public static string strUnitCodePriceCuocVo = "CUOCVO";
		public static string strUnitCodePriceThung = "THUNG";

        public User user { get; set; }
        private string _strTIdOrg;
        private static int iSeq = 0;
        //
        public string Username { get; set; }

        public string Password { get; set; }

        public string LanguageCode { set; get; }

        public string SessionId {set; get;}

		public string DealderCode { set; get; }

		public DateTime ServerDateTime { set; get; }

        public string TIdOrg {
            set {
                _strTIdOrg = value;
            }
        }

        public string GetNextTid(){
            return CUtils.TidNext(_strTIdOrg, ref iSeq);
        }

        private static SystemGlobal instance = null;

        public static SystemGlobal Instance {
            get
            {
                if (instance == null)
                    instance = new SystemGlobal();
                return instance;
            }
        }

        private SystemGlobal(){}
    }
}
